package com.erp.controller.viewController;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by ${JUN} on 2019/1/9.
 */
@Controller
public class BaseController {
    @RequestMapping("/{url}")
    public String baseUrl(@PathVariable("url")String url){
        return url;
    }

    @RequestMapping("/{view1:^erp_\\S*}/{view2}")
    public String getSubsets(@PathVariable("view1") String view1,
                             @PathVariable("view2") String view2){
        return view1+"/"+view2;
    }

    @RequestMapping("/{view1:^erp_\\S*}/{view2}/{view3}")
    public String getSubset(@PathVariable("view1") String view1,
                            @PathVariable("view2") String view2,
                            @PathVariable("view3") String view3){
        return view1+"/"+view2+"/"+view3;
    }
    @RequestMapping("/{view1:^erp_\\S*}/{view2}/{view3}/{view4}")
    public String getSubset(@PathVariable("view1") String view1,
                            @PathVariable("view2") String view2,
                            @PathVariable("view3") String view3,
                            @PathVariable("view4") String view4){
        return view1+"/"+view2+"/"+view3+"/"+view4;
    }
}
